﻿using Xejen.Ipc.Framework.Controllers;
using Xejen.Ipc.Framework.Steps;
using System;
using System.Collections.Generic;
using System.Text;

namespace Xejen.Ipc.Framework.Flows
{
    /// <summary>
    /// 表示发生错误时的参数
    /// </summary>
    /// <typeparam name="TData"><inheritdoc cref="IFlow{TData}" path="/typeparam[@name='TData']"/></typeparam>
    public class ErrorEventArgs<TData> : EventArgs
        where TData : new()
    {
        /// <summary>
        /// 错误异常
        /// </summary>
        public Exception Exception { get; set; }

        /// <summary>
        /// <inheritdoc cref="ErrorEventArgs{TData}"/>
        /// </summary>
        /// <param name="exception"><inheritdoc cref="Exception" path="/summary"/></param>
        public ErrorEventArgs(Exception exception)
        {
            Check.NotNull(exception, nameof(exception));

            Exception = exception;
        }
    }
}
